package xyz.thoughtset.viewer.common.core.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.SneakyThrows;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TitleMeta extends IdMeta{
    @TableField(whereStrategy = FieldStrategy.NOT_EMPTY,condition = SqlCondition.LIKE)
    protected String title;
    @TableField(condition = SqlCondition.LIKE)
    protected String remark;



    @SneakyThrows
    public static <T extends TitleMeta> T buildByOrder(String id, Class<T> clazz){
        T baseObj = clazz.getDeclaredConstructor().newInstance();
        baseObj.setId(id);
        return baseObj;
    }

}
